home *** CD-ROM | disk | FTP | other *** search
/ PCGUIA 117 / PC Guia 117.iso / Software / Utils / Software2 / Product11 / Setup.exe / MT-3.16-full-en_US / mt-testbg.cgi < prev    next >
Text File  |  2005-03-08  |  987b  |  48 lines

  1. #!/usr/bin/perl -w
  2. use strict;
  3.  
  4. # Copyright 2001-2005 Six Apart. This code cannot be redistributed without
  5. # permission from www.movabletype.org.
  6. #
  7. # $Id: mt-testbg.cgi 10197 2005-03-09 00:27:57Z ezra $
  8. use strict;
  9.  
  10. my($MT_DIR);
  11. BEGIN {
  12.     if ($0 =~ m!(.*[/\\])!) {
  13.         $MT_DIR = $1;
  14.     } else {
  15.         $MT_DIR = './';
  16.     }
  17.     unshift @INC, $MT_DIR . 'lib';
  18.     unshift @INC, $MT_DIR . 'extlib';
  19. }
  20.  
  21. local $| = 1;
  22. print "Content-Type: text/html\n\n";
  23. print "<pre>\n\n";
  24.  
  25. sub pfork {
  26.     fork();
  27. }
  28.  
  29. eval {
  30.     local $SIG{__WARN__} = sub { print "**** WARNING: $_[0]\n" };
  31.  
  32.     require MT;
  33.  
  34.     my $mt = MT->new( Config => $MT_DIR . 'mt.cfg')
  35.         or die MT->errstr;
  36.  
  37.     print "If you see only one number below, or if you see two and they match, you should add the line\n
  38.   LaunchBackgroundTasks 0\n\nto the file mt.cfg.\n\n-------------------\n\n";
  39.  
  40.     my $pid = pfork();
  41.     if (defined($pid) && !$pid) {
  42.     print "[$$]\n\n";
  43.     exit(0);
  44.     } else {
  45.     print "[$$]\n\n";
  46.     }
  47. }
  48.